home *** CD-ROM | disk | FTP | other *** search
- ; extendedPDF PostScript Printer Installer
- ; Copyright (c) JDiSoftware Limited, 2004
- ; Version 1.00
- ; This program is free software; you can redistribute it and/or modify
- ; it under the terms of the GNU General Public License as published by
- ; the Free Software Foundation; either version 2 of the License, or
- ; (at your option) any later version.
- ; This program is distributed in the hope that it will be useful,
- ; but WITHOUT ANY WARRANTY; without even the implied warranty of
- ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- ; GNU General Public License for more details.
- ; You should have received a copy of the GNU General Public License
- ; along with this program; if not, write to the Free Software
- ; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- ; Comments
- ; ========
- ; The main thing this setup has to do is add the correct include directory to
- ; the end of the epdf.ppd PPD file, so that the SGENPRT.PPD is found correctly.
- ; It also serves as a way to package everything and provide installation
- ; instructions.
- [Setup]
- AppName=extendedPDF PostScript Printer
- AppVerName=extendedPDF PostScript Printer 2.0
- AppPublisher=JDiSoftware
- AppPublisherURL=http://www.jdisoftware.co.uk
- AppSupportURL=http://www.jdisoftware.co.uk
- AppUpdatesURL=http://www.jdisoftware.co.uk
- AppId=extendedPDF_PS_Printer
- DefaultDirName={pf}\JDiSoftware\extendedPDF PS Printer
- DefaultGroupName=JDiSoftware\extendedPDF PostScript Printer
- CreateAppDir=yes
- Compression=lzma
- SolidCompression=yes
- LicenseFile=..\jdisoftware\license.txt
- VersionInfoVersion=2.0.0.0
- InfoAfterFile=../jdisoftware/infoafter.txt
- PrivilegesRequired=admin
- [Files]
- ; Printer driver files
- Source: ..\src\extendedPDF.inf; DestDir: {app}\driver; Flags: replacesameversion;
- Source: ..\src\EPDF.PPD; DestDir: {app}\driver; Flags: replacesameversion; AfterInstall: ApplyPpdInclude({app}\driver);
- Source: ..\src\SGENPRT.PPD; DestDir: {app}\driver; Flags: replacesameversion;
- Source: ..\src\COPYING.txt; DestDir: {app}; Flags: replacesameversion;
- Source: ..\jdisoftware\readme.html; DestDir: {app}\docs; Flags: replacesameversion;
- Source: ..\jdisoftware\uninstall.html; DestDir: {app}\docs; Flags: replacesameversion;
- Source: ..\jdisoftware\images\*.png; DestDir: {app}\docs\images; Flags: replacesameversion;
- ; Installer source files
- Source: ..\install-win32\ps-printer.iss; DestDir: "{app}\source"; Flags: replacesameversion;
- Source: ..\jdisoftware\infoafter.txt; DestDir: "{app}\source"; Flags: replacesameversion;
- Source: ..\jdisoftware\license.txt; DestDir: "{app}\source"; Flags: replacesameversion;
- [Icons]
- Name: "{group}\Installation Instructions"; Filename: {app}\docs\readme.html;
- Name: "{group}\Uninstallation Instructions"; Filename: {app}\docs\uninstall.html;
- Name: "{group}\{cm:UninstallProgram,extendedPDF PostScript Printer}"; Filename: "{uninstallexe}"
- [Run]
- Filename: rundll32.exe; Parameters: "shell32.dll,SHHelpShortcuts_RunDLL AddPrinter"; Description: "Run Add Printer Wizard"; StatusMsg: "Running Add Printer Wizard"; WorkingDir: "{app}\driver"; Flags: postinstall nowait;
- Filename: {app}\docs\readme.html; Description: "Display further installation instructions"; StatusMsg: "Displaying further installation instructions"; WorkingDir: "{app}"; Flags: postinstall nowait shellexec;
- [Code]
- {----------------------------------------------------------------------------}
- Taken from http://www13.brinkster.com/vincenzog/isxart.asp?idart=49
- function GetPrinterDriverDirectory(pName: PChar;
- pEnvironment: PChar;
- Level: LongInt;
- pDriverDirectory: PChar;
- cbBuf: LongInt;
- var pcbNeeded: LongInt): Integer;
- external 'GetPrinterDriverDirectoryA@winspool.drv';
- function GetLastError( ) : Integer;
- external 'GetLastError@kernel32.dll';
- function FindPrinterDriverDirectory(): String;
- bufSize: LongInt;
- driverDir: String;
- err: Integer;
- bufNeeded: LongInt;
- str: PChar;
- begin
- str := '';
- bufSize := 0;
- err := GetPrinterDriverDirectory(str, str, 1, str, bufSize, bufNeeded);
- driverDir := StringOfChar(' ', bufNeeded + 1);
- bufSize := bufNeeded;
- err := GetPrinterDriverDirectory(str, str, 1, driverDir, bufSize, bufNeeded);
- driverDir := CastIntegerToString(CastStringToInteger(driverDir));
- driverDir := AddBackslash(driverDir) + '3\';
- Result := driverDir;
- {----------------------------------------------------------------------------}
- Called after the installation of EPDF.PPD into the app\driver folder.
- Adds the necessary include at the end of EPDF.PPD to point to
- SGENPRT.PPD.
- procedure ApplyPpdInclude(appPath: String);
- filename: String;
- driverDir: String;
- newline: String;
- begin
- filename := AddBackslash(appPath) + 'EPDF.PPD';
- driverDir := FindPrinterDriverDirectory();
- newline := #13 + #10;
- SaveStringToFile(filename, newline + '*Include: "' + driverDir + 'SGENPRT.PPD"' + newline, True);
- {----------------------------------------------------------------------------}
-